import React, { Component } from 'react'
import { NavLink, Route, Switch, Redirect } from 'react-router-dom'
import SearchHot from './SearchHot'
import SearchLove from './SearchLove'
import '../index.css'

export default class Search extends Component {
  render() {
    return (
      <div>
        <h2>搜索</h2>
        <ul>
          <li>
            <NavLink activeClassName="twoActive" to="/search/hot">
              热门推荐
            </NavLink>
          </li>
          <li>
            <NavLink activeClassName="twoActive" to="/search/love">
              我的最爱
            </NavLink>
          </li>
        </ul>

        <Switch>
          <Redirect exact from="/search" to="/search/hot"></Redirect>
          <Route path="/search/hot" component={SearchHot}></Route>
          <Route path="/search/love" component={SearchLove}></Route>
        </Switch>
      </div>
    )
  }
}
